package com.annotation;

import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

import java.lang.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * User: lxf
 * Date: 2016/10/31
 * Time: 15:25
 * To change this template use Editor | File and Code Templates.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
//最高优先级
@Order(Ordered.HIGHEST_PRECEDENCE)
public @interface RequestLimit {

    /**
     * 允许访问的次数，默认值MAX_VALUE
     */
    int count();

    /**
     * 时间段，单位为毫秒，默认值一分钟
     */
    long time() default 60000;

}
